home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / fontutil.6 / fontutil / fontutils-0.6 / imageto / image-char.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-15  |  2.6 KB  |  90 lines

  1. /* image-char.h: information about the characters in the image.
  2.  
  3. Copyright (C) 1992 Free Software Foundation, Inc.
  4.  
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2, or (at your option)
  8. any later version.
  9.  
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. GNU General Public License for more details.
  14.  
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  18.  
  19. #ifndef IMAGE_CHAR_H
  20. #define IMAGE_CHAR_H
  21.  
  22. #include "types.h"
  23.  
  24.  
  25. /* A single character in the image.  */
  26. typedef struct 
  27. {
  28.   charcode_type charcode;
  29.   string charname;
  30.   boolean omit;
  31.   int baseline_adjust;
  32.   unsigned bb_count;
  33.   boolean alternating;
  34.   int lsb, rsb;
  35. } image_char_type;
  36.  
  37. /* The character code.  This is garbage if `omit' is true.  */
  38. #define IMAGE_CHARCODE(c) ((c).charcode)
  39.  
  40. /* The character name.  */
  41. #define IMAGE_CHARNAME(c) ((c).charname)
  42.  
  43. /* Says whether this character should be output.  */
  44. #define IMAGE_CHAR_OMIT(c) ((c).omit)
  45.  
  46. /* How far the baseline should be moved from the row's baseline.  */
  47. #define IMAGE_CHAR_BASELINE_ADJUST(c) ((c).baseline_adjust)
  48.  
  49. /* How many bounding boxes comprise this character.  */
  50. #define IMAGE_CHAR_BB_COUNT(c) ((c).bb_count)
  51.  
  52. /* Says whether the bounding boxes in this character are consecutive
  53.    (the usual case) or alternate.  */
  54. #define IMAGE_CHAR_BB_ALTERNATING(c) ((c).alternating)
  55.  
  56. /* The side bearings.  */
  57. #define IMAGE_CHAR_LSB(c) ((c).lsb)
  58. #define IMAGE_CHAR_RSB(c) ((c).rsb)
  59.  
  60.  
  61. /* A list of the above.  */
  62. typedef struct
  63. {
  64.   image_char_type *data;
  65.   unsigned length;
  66. } image_char_list_type;
  67.  
  68. /* The Nth element of the list L.  */
  69. #define IMAGE_CHAR(l, n) ((l).data[n])
  70.  
  71. /* The list as a whole.  */
  72. #define IMAGE_CHAR_LIST_DATA(l) ((l).data)
  73.  
  74. /* The length of the list.  */
  75. #define IMAGE_CHAR_LIST_LENGTH(l) ((l).length)
  76.  
  77.  
  78. /* Return an empty list.  */
  79. extern image_char_list_type new_image_char_list (void);
  80.  
  81. /* Append the character C to the list L.  */
  82. extern void append_image_char (image_char_list_type *l, image_char_type c);
  83.  
  84. /* Return false if the box BOX_COUNT boxes beyond FIRST_CHAR in LIST
  85.    is in the middle of a character, true otherwise.  */
  86. extern boolean box_at_char_boundary_p
  87.   (image_char_list_type list, unsigned first_char, unsigned box_count);
  88.  
  89. #endif /* not IMAGE_CHAR_H */
  90.